<template>
  <div>
    <el-tabs type="border-card">
      <el-tab-pane label="基本信息">
        <el-row>
          <el-col :span="6">
            <el-avatar :size="100" style="margin-left: 50px"> user </el-avatar>
          </el-col>
          <el-col :span="18" v-if="data">
            <el-descriptions
              title="用户信息"
              v-for="(x, i) in data.data"
              :key="i"
            >
              <el-descriptions-item label="用户名">{{
                x.uname
              }}</el-descriptions-item>
              <el-descriptions-item label="邮箱">{{
                x.uemail
              }}</el-descriptions-item>
              <el-descriptions-item label="手机号">{{
                x.uphone
              }}</el-descriptions-item>
              <el-descriptions-item label="生日">{{
                x.create_time
              }}</el-descriptions-item>
              <el-descriptions-item label="简介">{{
                x.uintroduce
              }}</el-descriptions-item>
            </el-descriptions>
          </el-col>
        </el-row>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
export default {
  data() {
    return {
      data: null,
    };
  },
  mounted() {
    this.getData();
  },
  methods: {
    getData() {
      const url = "/v1/userindex/data";
      const params = "uid=2";
      this.axios.post(url, params).then((res) => {
        console.log("用户:", res);
        this.data = res.data;
      });
    },
  },
};
</script>

<style lang="scss" scoped></style>
